#include<stdio.h>
#include<string.h>
#include<math.h>
#include<stdlib.h>
#include<ctype.h>
#include<string.h>

#define SQUARE(x) (x)*(x)
#define MAX(x,y) ((x)>(y)?(x):(y))
#define MIN(x,y) ((x)<(y)?(x):(y))

int main() {
	int n, i;
	int j;
	for (scanf("%d", &n); n--;) {
		scanf("%d", &i);
		for (j = 1; j <= i; j += 2)
			printf("%d ", j);
		printf("\n");
		for (j = 2; j <= i; j += 2)
			printf("%d ", j);
		printf("\n");
		printf("\n");
	}
	return 0;
}
